//定义路由表
import {
  UserOutlined,
  TeamOutlined,
  UserSwitchOutlined,
  FundProjectionScreenOutlined,
  NotificationOutlined,
  UnorderedListOutlined,
  ShopOutlined,
  TagOutlined
} from '@ant-design/icons'
import Dashboard from '../views/dashboard'
import NotFound from '../views/notfound'
import Notice from '../views/notice'
import ProductInfo from '../views/productinfo'
import ProductOnoff from '../views/productonoff'
import UserInfo from '../views/userinfo'
import UserOnoff from '../views/useronoff'
import Login from '../views/login'
import User from '../views/user'
import Product from '../views/product'

//白名单页面
const whiteList = [
  {
    path: '/login',
    component: Login
  },
  {
    path: '/404',
    component: NotFound
  }
]

//权限页面
const permissionList = [
  {
    path: '/admin/dashboard',
    component: Dashboard,
    meta: {
      title: '销售数据',
      icon: FundProjectionScreenOutlined,
      inMenu: true,
      hasChild: false,
      father: null,
      name: 'dashboard'
    }
  },
  {
    path: '/admin/notice',
    component: Notice,
    meta: {
      title: '公告管理',
      icon: NotificationOutlined,
      inMenu: true,
      hasChild: false,
      father: null,
      name: 'notice'
    }
  },
  {
    path: '/admin/user',
    component: User,
    meta: {
      title: '用户管理',
      icon: TeamOutlined,
      inMenu: true,
      hasChild: true,
      father: null,
      name: 'user'
    }
  },
  {
    path: '/admin/product',
    component: Product,
    meta: {
      title: '商品管理',
      icon: ShopOutlined,
      inMenu: true,
      hasChild: true,
      father: null,
      name: 'product'
    }
  },
  {
    path: '/admin/user/userinfo',
    component: UserInfo,
    meta: {
      title: '用户信息管理',
      icon: UserSwitchOutlined,
      inMenu: false,
      hasChild: false,
      father: 'user',
      name: 'userinfo'
    }
  },
  {
    path: '/admin/user/useronoff',
    component: UserOnoff,
    meta: {
      title: '用户状态管理',
      icon: UserOutlined,
      inMenu: false,
      hasChild: false,
      father: 'user',
      name: 'useronoff'
    }
  },
  {
    path: '/admin/product/productinfo',
    component: ProductInfo,
    meta: {
      title: '商品信息管理',
      icon: UnorderedListOutlined,
      inMenu: false,
      hasChild: false,
      father: 'product',
      name: 'productinfo'
    }
  },
  {
    path: '/admin/product/productonoff',
    component: ProductOnoff,
    meta: {
      title: '商品状态管理',
      icon: TagOutlined,
      inMenu: false,
      hasChild: false,
      father: 'product',
      name: 'productonoff'
    }
  }
]

export { whiteList, permissionList }
